<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>数据库驱动器参考 &mdash; CodeIgniter 3.0.0 中文手册|用户手册|用户指南|中文文档</title>
  

  
  
  <link rel="shortcut icon" href="../_static/ci-icon.ico" />
  

  
  <link href="../_static/css/fonts.css" rel="stylesheet" type="text/css" />

  
  
    

  

  
  
  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  

  
  <link rel="stylesheet" href="../_static/css/theme_cn.css" type="text/css" />
    <link rel="top" title="CodeIgniter 3.0.0 中文手册|用户手册|用户指南|中文文档" href="../index.html"/>
        <link rel="up" title="数据库参考" href="index.html"/>
        <link rel="next" title="教程 - 内容提要" href="../tutorial/index.html"/>
        <link rel="prev" title="数据库工具类" href="utilities.html"/> 

  
  <script src="../_static/js/modernizr.2.6.2.min.js"></script>

</head>

<body class="wy-body-for-nav" role="document">

  <div id="nav">
  <div id="nav_inner">
    
    
    
      <div id="pulldown-menu" class="ciNav">
        <ul>
<li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">欢迎使用 CodeIgniter</a><ul class="simple">
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">安装说明</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">下载 CodeIgniter</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">安装说明</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">从老版本升级</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">疑难解答</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter 概览</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">开始</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter 是什么？</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">支持特性</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">应用程序流程图</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">模型 - 视图 - 控制器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">架构目标</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">教程 - 内容提要</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">加载静态内容</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">读取新闻条目</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">创建新闻条目</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">结束语</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">向 CodeIgniter 贡献你的力量</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">编写 CodeIgniter 的文档</a></li>
<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer's Certificate of Origin 1.1</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/index.html">常规主题</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URL</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">控制器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">保留名称</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/views.html">视图</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/models.html">模型</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">使用 CodeIgniter 类库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">创建类库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">使用 CodeIgniter 驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">创建驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">创建核心系统类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">创建附属类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">钩子 - 扩展框架核心</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">自动加载资源</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">公共函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">兼容性函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI 路由</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">错误处理</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">网页缓存</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">程序分析</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">以 CLI 方式运行</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">管理你的应用程序</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">处理多环境</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">在视图文件中使用 PHP 替代语法</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/security.html">安全</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP 开发规范</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">类库参考</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">基准测试类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">缓存驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">日历类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">购物车类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">配置类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">加密类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">加密类（新版）</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">文件上传类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">表单验证类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">图像处理类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">输入类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">语言类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">加载器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">迁移类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">输出类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">分页类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">模板解析类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">安全类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML 表格类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">引用通告类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">排版类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">单元测试类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">用户代理类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC 与 XML-RPC 服务器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip 编码类</a></li>
</ul>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">数据库参考</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="examples.html">数据库快速入门: 示例代码</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html">数据库配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="connecting.html">连接数据库</a></li>
<li class="toctree-l2"><a class="reference internal" href="queries.html">查询</a></li>
<li class="toctree-l2"><a class="reference internal" href="results.html">生成查询结果</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers.html">查询辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="query_builder.html">查询构造器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="transactions.html">事务</a></li>
<li class="toctree-l2"><a class="reference internal" href="metadata.html">获取元数据</a></li>
<li class="toctree-l2"><a class="reference internal" href="call_function.html">自定义函数调用</a></li>
<li class="toctree-l2"><a class="reference internal" href="caching.html">查询缓存</a></li>
<li class="toctree-l2"><a class="reference internal" href="forge.html">使用 Database Forge 维护数据库</a></li>
<li class="toctree-l2"><a class="reference internal" href="utilities.html">数据库工具类</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="">数据库驱动器参考</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">辅助函数参考</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">数组辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">验证码辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">日期辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">目录辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">下载辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">邮件辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">文件辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">表单辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">语言辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">数字辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">路径辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">安全辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">表情辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">字符串辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">文本辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">排版辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML 辅助函数</a></li>
</ul>
</li>
</ul>

      </div>
    
      
  </div>
</div>
<div id="nav2">
  <a href="#" id="openToc">
    <img src="" title="切换目录" alt="切换目录" />
  </a>
</div>

  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-nav-search">
        
          <a href="../index.html" class="fa fa-home"> CodeIgniter</a>
        
        
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="搜索手册" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
      </div>

      <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
        
          
          
              <ul>
<li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">欢迎使用 CodeIgniter</a><ul class="simple">
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">安装说明</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">下载 CodeIgniter</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">安装说明</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">从老版本升级</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">疑难解答</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter 概览</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">开始</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter 是什么？</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">支持特性</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">应用程序流程图</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">模型 - 视图 - 控制器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">架构目标</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">教程 - 内容提要</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">加载静态内容</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">读取新闻条目</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">创建新闻条目</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">结束语</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">向 CodeIgniter 贡献你的力量</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">编写 CodeIgniter 的文档</a></li>
<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer's Certificate of Origin 1.1</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/index.html">常规主题</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URL</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">控制器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">保留名称</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/views.html">视图</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/models.html">模型</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">使用 CodeIgniter 类库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">创建类库</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">使用 CodeIgniter 驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">创建驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">创建核心系统类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">创建附属类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">钩子 - 扩展框架核心</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">自动加载资源</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">公共函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">兼容性函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI 路由</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">错误处理</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">网页缓存</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">程序分析</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">以 CLI 方式运行</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">管理你的应用程序</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">处理多环境</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">在视图文件中使用 PHP 替代语法</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/security.html">安全</a></li>
<li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP 开发规范</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">类库参考</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">基准测试类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">缓存驱动器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">日历类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">购物车类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">配置类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">加密类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">加密类（新版）</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">文件上传类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">表单验证类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">图像处理类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">输入类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">语言类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">加载器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">迁移类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">输出类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">分页类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">模板解析类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">安全类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML 表格类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">引用通告类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">排版类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">单元测试类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI 类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">用户代理类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC 与 XML-RPC 服务器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip 编码类</a></li>
</ul>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">数据库参考</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="examples.html">数据库快速入门: 示例代码</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html">数据库配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="connecting.html">连接数据库</a></li>
<li class="toctree-l2"><a class="reference internal" href="queries.html">查询</a></li>
<li class="toctree-l2"><a class="reference internal" href="results.html">生成查询结果</a></li>
<li class="toctree-l2"><a class="reference internal" href="helpers.html">查询辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="query_builder.html">查询构造器类</a></li>
<li class="toctree-l2"><a class="reference internal" href="transactions.html">事务</a></li>
<li class="toctree-l2"><a class="reference internal" href="metadata.html">获取元数据</a></li>
<li class="toctree-l2"><a class="reference internal" href="call_function.html">自定义函数调用</a></li>
<li class="toctree-l2"><a class="reference internal" href="caching.html">查询缓存</a></li>
<li class="toctree-l2"><a class="reference internal" href="forge.html">使用 Database Forge 维护数据库</a></li>
<li class="toctree-l2"><a class="reference internal" href="utilities.html">数据库工具类</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="">数据库驱动器参考</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">辅助函数参考</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">数组辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">验证码辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">日期辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">目录辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">下载辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">邮件辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">文件辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">表单辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">语言辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">数字辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">路径辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">安全辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">表情辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">字符串辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">文本辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">排版辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL 辅助函数</a></li>
<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML 辅助函数</a></li>
</ul>
</li>
</ul>

          
        
      </div>
      &nbsp;
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
        <a href="../index.html">CodeIgniter</a>
      </nav>


      
      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    <li><a href="../index.html">首页</a> &raquo; </li>
    
    <li><a href="index.html">数据库参考</a> &raquo; </li>
    
    <li>数据库驱动器参考</li>
    <li class="wy-breadcrumbs-aside">
      
    </li>
    <div style="float:right;">
      <div style="text-decoration:underline;color:blue;margin-left:5px;cursor:pointer;" id="closeMe">
        <img title="目录" alt="toc" src="" />
      </div>
    </div>
  </ul>
  <hr/>
</div>
          <div role="main" class="document">
            
  <div class="section" id="id1">
<h1>数据库驱动器参考<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h1>
<p>这是一个平台无关的数据库实现基类，该类不会被直接调用，
而是通过特定的数据库适配器类来继承和实现该类。</p>
<p>关于数据库驱动器，已经在其他几篇文档中介绍过，这篇文档将作为它们的一个参考。</p>
<div class="admonition important">
<p class="first admonition-title">重要</p>
<p class="last">并不是所有的方法都被所有的数据库驱动器所支持，
当不支持的时候，有些方法可能会失败（返回 FALSE）。</p>
</div>
<dl class="class">
<dt id="CI_DB_driver">
<em class="property">class </em><tt class="descname">CI_DB_driver</tt><a class="headerlink" href="#CI_DB_driver" title="永久链接至目标">¶</a></dt>
<dd><dl class="method">
<dt id="CI_DB_driver::initialize">
<tt class="descname">initialize</tt><big>(</big><big>)</big><a class="headerlink" href="#CI_DB_driver::initialize" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">返回:</th><td class="field-body">TRUE on success, FALSE on failure</td>
</tr>
<tr class="field-even field"><th class="field-name">返回类型:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
<p>初始化数据库配置，建立对数据库的连接。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::db_connect">
<tt class="descname">db_connect</tt><big>(</big><em>$persistent = TRUE</em><big>)</big><a class="headerlink" href="#CI_DB_driver::db_connect" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$persistent</strong> (<em>bool</em>) -- Whether to establish a persistent connection or a regular one</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">Database connection resource/object or FALSE on failure</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">mixed</p>
</td>
</tr>
</tbody>
</table>
<p>建立对数据库的连接。</p>
<div class="admonition note">
<p class="first admonition-title">注解</p>
<p class="last">返回值取决于当前使用的数据库驱动器，例如 <tt class="docutils literal"><span class="pre">mysqli</span></tt> 实例将会返回 'mysqli' 驱动器。</p>
</div>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::db_pconnect">
<tt class="descname">db_pconnect</tt><big>(</big><big>)</big><a class="headerlink" href="#CI_DB_driver::db_pconnect" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">返回:</th><td class="field-body">Database connection resource/object or FALSE on failure</td>
</tr>
<tr class="field-even field"><th class="field-name">返回类型:</th><td class="field-body">mixed</td>
</tr>
</tbody>
</table>
<p>建立对数据库的连接，使用持久连接。</p>
<div class="admonition note">
<p class="first admonition-title">注解</p>
<p class="last">该方法其实就是调用 <tt class="docutils literal"><span class="pre">db_connect(TRUE)</span></tt> 。</p>
</div>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::reconnect">
<tt class="descname">reconnect</tt><big>(</big><big>)</big><a class="headerlink" href="#CI_DB_driver::reconnect" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">返回:</th><td class="field-body">TRUE on success, FALSE on failure</td>
</tr>
<tr class="field-even field"><th class="field-name">返回类型:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
<p>如果超过服务器的超时时间都没有发送任何查询请求，
使用该方法可以让数据库连接保持有效，或重新连接数据库。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::db_select">
<tt class="descname">db_select</tt><big>(</big><span class="optional">[</span><em>$database = ''</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_DB_driver::db_select" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$database</strong> (<em>string</em>) -- Database name</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">TRUE on success, FALSE on failure</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">bool</p>
</td>
</tr>
</tbody>
</table>
<p>切换到某个数据库。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::db_set_charset">
<tt class="descname">db_set_charset</tt><big>(</big><em>$charset</em><big>)</big><a class="headerlink" href="#CI_DB_driver::db_set_charset" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$charset</strong> (<em>string</em>) -- Character set name</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">TRUE on success, FALSE on failure</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">bool</p>
</td>
</tr>
</tbody>
</table>
<p>设置客户端字符集。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::platform">
<tt class="descname">platform</tt><big>(</big><big>)</big><a class="headerlink" href="#CI_DB_driver::platform" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">返回:</th><td class="field-body">Platform name</td>
</tr>
<tr class="field-even field"><th class="field-name">返回类型:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
<p>当前使用的数据库平台（mysql、mssql 等）。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::version">
<tt class="descname">version</tt><big>(</big><big>)</big><a class="headerlink" href="#CI_DB_driver::version" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">返回:</th><td class="field-body">The version of the database being used</td>
</tr>
<tr class="field-even field"><th class="field-name">返回类型:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
<p>数据库版本。</p>
</dd></dl>

<dl class="method">
<dt>
<tt class="descname">query($sql[, $binds = FALSE[, $return_object = NULL]]])</tt></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$sql</strong> (<em>string</em>) -- The SQL statement to execute</li>
<li><strong>$binds</strong> (<em>array</em>) -- An array of binding data</li>
<li><strong>$return_object</strong> (<em>bool</em>) -- Whether to return a result object or not</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">TRUE for successful &quot;write-type&quot; queries, CI_DB_result instance (method chaining) on &quot;query&quot; success, FALSE on failure</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">mixed</p>
</td>
</tr>
</tbody>
</table>
<p>执行一个 SQL 查询。</p>
<p>如果是读类型的查询，执行 SQL 成功后将返回结果对象。</p>
<p>有以下几种可能的返回值：</p>
<blockquote>
<div><ul class="simple">
<li>如果是写类型的查询，执行成功返回 TRUE</li>
<li>执行失败返回 FALSE</li>
<li>如果是读类型的查询，执行成功返回 <tt class="docutils literal"><span class="pre">CI_DB_result</span></tt> 对象</li>
</ul>
</div></blockquote>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::simple_query">
<tt class="descname">simple_query</tt><big>(</big><em>$sql</em><big>)</big><a class="headerlink" href="#CI_DB_driver::simple_query" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$sql</strong> (<em>string</em>) -- The SQL statement to execute</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">Whatever the underlying driver's &quot;query&quot; function returns</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">mixed</p>
</td>
</tr>
</tbody>
</table>
<p><tt class="docutils literal"><span class="pre">query()</span></tt> 方法的简化版，当你只需要简单的执行一个查询，并不关心查询的结果时，
可以使用该方法。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::trans_strict">
<tt class="descname">trans_strict</tt><big>(</big><span class="optional">[</span><em>$mode = TRUE</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_DB_driver::trans_strict" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$mode</strong> (<em>bool</em>) -- Strict mode flag</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">void</p>
</td>
</tr>
</tbody>
</table>
<p>启用或禁用事务的严格模式。</p>
<p>在严格模式下，如果你正在运行多组事务，只要有一组失败，所有组都会被回滚。</p>
<p>如果禁用严格模式，那么每一组都被视为独立的组，这意味着其中一组失败不会影响其他的组。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::trans_off">
<tt class="descname">trans_off</tt><big>(</big><big>)</big><a class="headerlink" href="#CI_DB_driver::trans_off" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body">void</td>
</tr>
</tbody>
</table>
<p>实时的禁用事务。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::trans_start">
<tt class="descname">trans_start</tt><big>(</big><span class="optional">[</span><em>$test_mode = FALSE</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_DB_driver::trans_start" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$test_mode</strong> (<em>bool</em>) -- Test mode flag</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">void</p>
</td>
</tr>
</tbody>
</table>
<p>开启一个事务。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::trans_complete">
<tt class="descname">trans_complete</tt><big>(</big><big>)</big><a class="headerlink" href="#CI_DB_driver::trans_complete" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body">void</td>
</tr>
</tbody>
</table>
<p>结束事务。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::trans_status">
<tt class="descname">trans_status</tt><big>(</big><big>)</big><a class="headerlink" href="#CI_DB_driver::trans_status" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">返回:</th><td class="field-body">TRUE if the transaction succeeded, FALSE if it failed</td>
</tr>
<tr class="field-even field"><th class="field-name">返回类型:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
<p>获取事务的状态，用来判断事务是否执行成功。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::compile_binds">
<tt class="descname">compile_binds</tt><big>(</big><em>$sql</em>, <em>$binds</em><big>)</big><a class="headerlink" href="#CI_DB_driver::compile_binds" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$sql</strong> (<em>string</em>) -- The SQL statement</li>
<li><strong>$binds</strong> (<em>array</em>) -- An array of binding data</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">The updated SQL statement</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>根据绑定的参数值编译 SQL 查询。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::is_write_type">
<tt class="descname">is_write_type</tt><big>(</big><em>$sql</em><big>)</big><a class="headerlink" href="#CI_DB_driver::is_write_type" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$sql</strong> (<em>string</em>) -- The SQL statement</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">TRUE if the SQL statement is of &quot;write type&quot;, FALSE if not</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">bool</p>
</td>
</tr>
</tbody>
</table>
<p>判断查询是写类型（INSERT、UPDATE、DELETE），还是读类型（SELECT）。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::elapsed_time">
<tt class="descname">elapsed_time</tt><big>(</big><span class="optional">[</span><em>$decimals = 6</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_DB_driver::elapsed_time" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$decimals</strong> (<em>int</em>) -- The number of decimal places</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">The aggregate query elapsed time, in microseconds</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>计算查询所消耗的时间。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::total_queries">
<tt class="descname">total_queries</tt><big>(</big><big>)</big><a class="headerlink" href="#CI_DB_driver::total_queries" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">返回:</th><td class="field-body">The total number of queries executed</td>
</tr>
<tr class="field-even field"><th class="field-name">返回类型:</th><td class="field-body">int</td>
</tr>
</tbody>
</table>
<p>返回当前已经执行了多少次查询。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::last_query">
<tt class="descname">last_query</tt><big>(</big><big>)</big><a class="headerlink" href="#CI_DB_driver::last_query" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">返回:</th><td class="field-body">The last query executed</td>
</tr>
<tr class="field-even field"><th class="field-name">返回类型:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
<p>返回上一次执行的查询。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::escape">
<tt class="descname">escape</tt><big>(</big><em>$str</em><big>)</big><a class="headerlink" href="#CI_DB_driver::escape" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$str</strong> (<em>mixed</em>) -- The value to escape, or an array of multiple ones</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">The escaped value(s)</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">mixed</p>
</td>
</tr>
</tbody>
</table>
<p>根据输入数据的类型进行数据转义，包括布尔值和空值。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::escape_str">
<tt class="descname">escape_str</tt><big>(</big><em>$str</em><span class="optional">[</span>, <em>$like = FALSE</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_DB_driver::escape_str" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$str</strong> (<em>mixed</em>) -- A string value or array of multiple ones</li>
<li><strong>$like</strong> (<em>bool</em>) -- Whether or not the string will be used in a LIKE condition</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">The escaped string(s)</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">mixed</p>
</td>
</tr>
</tbody>
</table>
<p>转义字符串。</p>
<div class="admonition warning">
<p class="first admonition-title">警告</p>
<p class="last">返回的字符串没有用引号引起来。</p>
</div>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::escape_like_str">
<tt class="descname">escape_like_str</tt><big>(</big><em>$str</em><big>)</big><a class="headerlink" href="#CI_DB_driver::escape_like_str" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$str</strong> (<em>mixed</em>) -- A string value or array of multiple ones</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">The escaped string(s)</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">mixed</p>
</td>
</tr>
</tbody>
</table>
<p>转义 LIKE 字符串。</p>
<p>和 <tt class="docutils literal"><span class="pre">escape_str()</span></tt> 方法类似，但同时也对 LIKE 语句中的 <tt class="docutils literal"><span class="pre">%</span></tt> 和 <tt class="docutils literal"><span class="pre">_</span></tt>
通配符进行转义。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::primary">
<tt class="descname">primary</tt><big>(</big><em>$table</em><big>)</big><a class="headerlink" href="#CI_DB_driver::primary" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$table</strong> (<em>string</em>) -- Table name</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">The primary key name, FALSE if none</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>获取一个表的主键。</p>
<div class="admonition note">
<p class="first admonition-title">注解</p>
<p class="last">如果数据库不支持主键检测，将假设第一列就是主键。</p>
</div>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::count_all">
<tt class="descname">count_all</tt><big>(</big><span class="optional">[</span><em>$table = ''</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_DB_driver::count_all" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$table</strong> (<em>string</em>) -- Table name</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">Row count for the specified table</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">int</p>
</td>
</tr>
</tbody>
</table>
<p>返回表中的总记录数。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::list_tables">
<tt class="descname">list_tables</tt><big>(</big><span class="optional">[</span><em>$constrain_by_prefix = FALSE</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_DB_driver::list_tables" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$constrain_by_prefix</strong> (<em>bool</em>) -- TRUE to match table names by the configured dbprefix</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">Array of table names or FALSE on failure</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">array</p>
</td>
</tr>
</tbody>
</table>
<p>返回当前数据库的所有表。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::table_exists">
<tt class="descname">table_exists</tt><big>(</big><em>$table_name</em><big>)</big><a class="headerlink" href="#CI_DB_driver::table_exists" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$table_name</strong> (<em>string</em>) -- The table name</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">TRUE if that table exists, FALSE if not</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">bool</p>
</td>
</tr>
</tbody>
</table>
<p>判断某个数据库表是否存在。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::list_fields">
<tt class="descname">list_fields</tt><big>(</big><em>$table</em><big>)</big><a class="headerlink" href="#CI_DB_driver::list_fields" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$table</strong> (<em>string</em>) -- The table name</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">Array of field names or FALSE on failure</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">array</p>
</td>
</tr>
</tbody>
</table>
<p>返回某个表的所有字段名。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::field_exists">
<tt class="descname">field_exists</tt><big>(</big><em>$field_name</em>, <em>$table_name</em><big>)</big><a class="headerlink" href="#CI_DB_driver::field_exists" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$table_name</strong> (<em>string</em>) -- The table name</li>
<li><strong>$field_name</strong> (<em>string</em>) -- The field name</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">TRUE if that field exists in that table, FALSE if not</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">bool</p>
</td>
</tr>
</tbody>
</table>
<p>判断某个字段是否存在。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::field_data">
<tt class="descname">field_data</tt><big>(</big><em>$table</em><big>)</big><a class="headerlink" href="#CI_DB_driver::field_data" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$table</strong> (<em>string</em>) -- The table name</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">Array of field data items or FALSE on failure</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">array</p>
</td>
</tr>
</tbody>
</table>
<p>获取某个表的所有字段信息。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::escape_identifiers">
<tt class="descname">escape_identifiers</tt><big>(</big><em>$item</em><big>)</big><a class="headerlink" href="#CI_DB_driver::escape_identifiers" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$item</strong> (<em>mixed</em>) -- The item or array of items to escape</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">The input item(s), escaped</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">mixed</p>
</td>
</tr>
</tbody>
</table>
<p>对 SQL 标识符进行转义，例如列名、表名、关键字。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::insert_string">
<tt class="descname">insert_string</tt><big>(</big><em>$table</em>, <em>$data</em><big>)</big><a class="headerlink" href="#CI_DB_driver::insert_string" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$table</strong> (<em>string</em>) -- The target table</li>
<li><strong>$data</strong> (<em>array</em>) -- An associative array of key/value pairs</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">The SQL INSERT statement, as a string</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>生成 INSERT 语句。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::update_string">
<tt class="descname">update_string</tt><big>(</big><em>$table</em>, <em>$data</em>, <em>$where</em><big>)</big><a class="headerlink" href="#CI_DB_driver::update_string" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$table</strong> (<em>string</em>) -- The target table</li>
<li><strong>$data</strong> (<em>array</em>) -- An associative array of key/value pairs</li>
<li><strong>$where</strong> (<em>mixed</em>) -- The WHERE statement conditions</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">The SQL UPDATE statement, as a string</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>生成 UPDATE 语句。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::call_function">
<tt class="descname">call_function</tt><big>(</big><em>$function</em><big>)</big><a class="headerlink" href="#CI_DB_driver::call_function" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$function</strong> (<em>string</em>) -- Function name</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">The function result</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>使用一种平台无关的方式执行一个原生的 PHP 函数。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::cache_set_path">
<tt class="descname">cache_set_path</tt><big>(</big><span class="optional">[</span><em>$path = ''</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_DB_driver::cache_set_path" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$path</strong> (<em>string</em>) -- Path to the cache directory</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">void</p>
</td>
</tr>
</tbody>
</table>
<p>设置缓存路径。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::cache_on">
<tt class="descname">cache_on</tt><big>(</big><big>)</big><a class="headerlink" href="#CI_DB_driver::cache_on" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">返回:</th><td class="field-body">TRUE if caching is on, FALSE if not</td>
</tr>
<tr class="field-even field"><th class="field-name">返回类型:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
<p>启用数据库结果缓存。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::cache_off">
<tt class="descname">cache_off</tt><big>(</big><big>)</big><a class="headerlink" href="#CI_DB_driver::cache_off" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">返回:</th><td class="field-body">TRUE if caching is on, FALSE if not</td>
</tr>
<tr class="field-even field"><th class="field-name">返回类型:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
<p>禁用数据库结果缓存。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::cache_delete">
<tt class="descname">cache_delete</tt><big>(</big><span class="optional">[</span><em>$segment_one = ''</em><span class="optional">[</span>, <em>$segment_two = ''</em><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_DB_driver::cache_delete" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$segment_one</strong> (<em>string</em>) -- First URI segment</li>
<li><strong>$segment_two</strong> (<em>string</em>) -- Second URI segment</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">TRUE on success, FALSE on failure</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">bool</p>
</td>
</tr>
</tbody>
</table>
<p>删除特定 URI 的缓存文件。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::cache_delete_all">
<tt class="descname">cache_delete_all</tt><big>(</big><big>)</big><a class="headerlink" href="#CI_DB_driver::cache_delete_all" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">返回:</th><td class="field-body">TRUE on success, FALSE on failure</td>
</tr>
<tr class="field-even field"><th class="field-name">返回类型:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
<p>删除所有缓存文件。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::close">
<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#CI_DB_driver::close" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body">void</td>
</tr>
</tbody>
</table>
<p>关闭数据库的连接。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::display_error">
<tt class="descname">display_error</tt><big>(</big><span class="optional">[</span><em>$error = ''</em><span class="optional">[</span>, <em>$swap = ''</em><span class="optional">[</span>, <em>$native = FALSE</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_DB_driver::display_error" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$error</strong> (<em>string</em>) -- The error message</li>
<li><strong>$swap</strong> (<em>string</em>) -- Any &quot;swap&quot; values</li>
<li><strong>$native</strong> (<em>bool</em>) -- Whether to localize the message</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first">void</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回:</th><td class="field-body"><p class="first last">Displays the DB error screensends the application/views/errors/error_db.php template</p>
</td>
</tr>
</tbody>
</table>
<p>显示一个错误信息，并终止脚本执行。</p>
<p>错误信息是使用 <em>application/views/errors/error_db.php</em> 文件中的模板来显示。</p>
</dd></dl>

<dl class="method">
<dt id="CI_DB_driver::protect_identifiers">
<tt class="descname">protect_identifiers</tt><big>(</big><em>$item</em><span class="optional">[</span>, <em>$prefix_single = FALSE</em><span class="optional">[</span>, <em>$protect_identifiers = NULL</em><span class="optional">[</span>, <em>$field_exists = TRUE</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_DB_driver::protect_identifiers" title="永久链接至目标">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>$item</strong> (<em>string</em>) -- The item to work with</li>
<li><strong>$prefix_single</strong> (<em>bool</em>) -- Whether to apply the dbprefix even if the input item is a single identifier</li>
<li><strong>$protect_identifiers</strong> (<em>bool</em>) -- Whether to quote identifiers</li>
<li><strong>$field_exists</strong> (<em>bool</em>) -- Whether the supplied item contains a field name or not</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">The modified item</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
<p>根据配置的 <em>dbprefix</em> 参数，给列名或表名（可能是表别名）添加一个前缀。</p>
<p>为了处理包含路径的列名，必须要考虑一些逻辑。</p>
<p>例如下面的查询:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nx">SELECT</span> <span class="o">*</span> <span class="nx">FROM</span> <span class="nx">hostname</span><span class="o">.</span><span class="nx">database</span><span class="o">.</span><span class="nx">table</span><span class="o">.</span><span class="nx">column</span> <span class="k">AS</span> <span class="nx">c</span> <span class="nx">FROM</span> <span class="nx">hostname</span><span class="o">.</span><span class="nx">database</span><span class="o">.</span><span class="nx">table</span>
</pre></div>
</div>
<p>或者下面这个查询，使用了表别名:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nx">SELECT</span> <span class="nx">m</span><span class="o">.</span><span class="nx">member_id</span><span class="p">,</span> <span class="nx">m</span><span class="o">.</span><span class="nx">member_name</span> <span class="nx">FROM</span> <span class="nx">members</span> <span class="k">AS</span> <span class="nx">m</span>
</pre></div>
</div>
<p>由于列名可以包含四段（主机、数据库名、表名、字段名）或者有一个表别名的前缀，
我们需要做点工作来判断这一点，才能将 <em>dbprefix</em> 插入到正确的位置。</p>
<p>该方法在查询构造器类中被广泛使用。</p>
</dd></dl>

</dd></dl>

</div>


          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="../tutorial/index.html" class="btn btn-neutral float-right" title="教程 - 内容提要">下一个主题 <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="utilities.html" class="btn btn-neutral" title="数据库工具类"><span class="fa fa-arrow-circle-left"></span> 上一个主题</a>
      
    </div>
  

  
  <div id="notes">
  
  <!-- 多说评论框 start -->
    <div class="ds-thread" data-thread-key="userguide3/database/db_driver_reference" data-title="数据库驱动器参考" data-url="http://codeigniter.org.cn/user_guide/database/db_driver_reference.html"></div>
  <!-- 多说评论框 end -->
  

  <div class="ds-share flat" data-thread-key="userguide3/database/db_driver_reference" data-title="数据库驱动器参考 &mdash; CodeIgniter 3.0.0 中文手册|用户手册|用户指南|中文文档" data-url="http://codeigniter.org.cn/user_guide/database/db_driver_reference.html" data-images="" data-content="">
    <div class="ds-share-inline">
      <ul  class="ds-share-icons-16">

        <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
        <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
        <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
        <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
        <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

      </ul>
      <div class="ds-share-icons-more">
      </div>
    </div>
  </div>

  <!-- 多说公共JS代码 start (一个网页只需插入一次) -->
  <script type="text/javascript">
    var duoshuoQuery = {short_name:"codeigniter"};
    (function() {
        var ds = document.createElement('script');
        ds.type = 'text/javascript';ds.async = true;
        ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
        ds.charset = 'UTF-8';
        (document.getElementsByTagName('head')[0]
         || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
    </script>
  <!-- 多说公共JS代码 end -->
  </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; 版权所有 2014 - 2015, 不列颠哥伦比亚理工学院.
       最后修改: 2015-10-11.
    </p>

    <p>以 <a href="http://www.aneasystone.com/" target="_blank">aneasystone</a> 制作的手册为基础构建</p>
  </div>

  
    <p>基于 <a href="http://sphinx-doc.org/">Sphinx</a> 并使用 <a href="https://readthedocs.org">Read the Docs</a> 提供的<a href="https://github.com/snide/sphinx_rtd_theme">风格</a>构建</p>
    <p>
        <a href="https://github.com/CodeIgniter-Chinese/codeigniter-user-guide" target="_blank">Github 简体中文翻译</a>
        ·
        <a href="http://codeigniter-chinese.github.io/codeigniter-user-guide/codeigniter_user_guide.zip">离线版压缩包下载</a>
        ·
        <a href="http://codeigniter-chinese.github.io/codeigniter-user-guide/CodeIgniter.pdf">PDF 版下载</a>
    </p>
  

</footer>
        </div>
      </div>

    </section>

  </div>
  

  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'../',
            VERSION:'3.0.2',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  false
        };
    </script>
      <script type="text/javascript" src="../_static/jquery.js"></script>
      <script type="text/javascript" src="../_static/underscore.js"></script>
      <script type="text/javascript" src="../_static/doctools.js"></script>
      <script type="text/javascript" src="../_static/translations.js"></script>

  

  
  
    <script type="text/javascript" src="../_static/js/theme.js"></script>
  

  
  
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>
   

  
    <script>
        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

        ga('create', 'UA-272152-3', 'auto');
        ga('send', 'pageview');
    </script>
  

</body>
</html>